<?

function f_extension($fn){
	$str=explode('/',$fn);
	$len=count($str);
	$str2=explode('.',$str[($len-1)]);
	$len2=count($str2);
	$ext=$str2[($len2-1)];
	return $ext;
}

sleep(3);
$file = $_FILES['fileupload']['name'];
$typefile = $_FILES['fileupload']['type']; 
$sizefile = $_FILES['fileupload']['size']; 
$tempfile = "usr/product/tmp/".date("YmdHis").".".f_extension($file);
copy($_FILES['fileupload']['tmp_name'],$tempfile);
?>
<script language="JavaScript">
 <!--
window.parent.uploadok('<?=$tempfile?>');
 //-->
</script>